﻿using System;
using System.Web;
using System.Text;

/// <summary>
/// AdminpageBase 的摘要说明
/// </summary>
public class AdminpageBase : System.Web.UI.Page
{
    /// <summary>
    /// 获取当前登录用户信息
    /// </summary>
    protected Model.Manageadmin loginUserInfo = null;
    /// <summary>
    /// 初始化
    /// </summary>
    protected virtual void Page_Init()
    {
        #region 检查登录状态
        ckLogin();
        #endregion
    }
    /// <summary>
    /// 检查登录状态
    /// </summary>
    protected void ckLogin()
    {
        //获取登录信息
        loginUserInfo = BLL.CMember.ManageadminLoginInfo();
        //当前用户没有登录
        if (loginUserInfo == null)
        {
            //System.Web.HttpContext.Current.Response.Redirect("/manage/admin_Login.aspx");
            System.Web.HttpContext.Current.Response.Write("<script type=\"text/javascript\">window.location.href = '/manage/admin_Login.aspx';</script>");
        }
    }
    public void alertmessage(string message)
    {
        System.Web.HttpContext.Current.Response.Write("<script type=\"text/javascript\">alert('" + message + "');</script>");
    }
    public void alertmessageAndGoback(string message)
    {
        System.Web.HttpContext.Current.Response.Write("<script type=\"text/javascript\">alert('" + message + "');history.go(-1);</script>");
    }
    public void alertmessageAndGo(string message, string url)
    {
        System.Web.HttpContext.Current.Response.Write("<script type=\"text/javascript\">alert('" + message + "');window.location.href = '" + url + "';</script>");
    }
}